<template>
  <div>
    <van-nav-bar title="订单" left-text="返回" left-arrow></van-nav-bar>
    <van-divider>您的订单</van-divider>
    <div class="contentHistory" v-for="(item, index) in Car" :key="index">
      <van-row style="margin-top: 15px; margin-bottom: 15px">
        <van-col offset="1" span="5">
          <van-image height="60px" width="60px" :src="item.itemSrc"></van-image>
        </van-col>
        <van-col offset="" span="14">
          <van-row class="textInList">
            下单时间：{{ item.logindate | timeregular }}</van-row
          >
          <van-row class="textInList">
            总金额： ￥{{ sumPrice(item) }} 元</van-row
          >
        </van-col>
        <van-col offset="" span="3"> </van-col>
      </van-row>
    </div>
  </div>
</template>
<script>
export default {
  props: ["Car"],
  data() {
    return {
      showPop: false,
      
    };
  },
  methods: {
    ShowPop: function () {
      this.showPop = true;
    },
  },
  computed: {
    sumPrice: function () {
      return function (item) {
        var sum = 0;
        var m = item.itemPrice;
        var n = item.itemCount;
        sum = m * n + sum;
        return sum;
      };
    },
  },
  filters: {
    timeregular: function (value) {
      var temp = new Date(value);
      var year = temp.getFullYear();
      var month = (temp.getMonth() + 1).toString().padStart(2, "0");
      var day = temp.getDate().toString().padStart(2, "0");
      var hour = temp.getHours().toString().padStart(2, "0");
      var minute = temp.getMinutes().toString().padStart(2, "0");
      return year + "年" + month + "月" + day + "日" + hour + ":" + minute;
    },
  },
};
</script>
<style scoped>
.contentHistory {
  margin-left: 5%;
  padding-top: 5px;
  padding-bottom: 5px;
  border-radius: 10px;
  margin-top: 20px;
  font-size: 10px;
  color: rgb(54, 54, 54);
  width: 90%;
}
.name {
  float: left;
}
.price {
  float: left;
  text-align: left;
}
.left img {
  width: 160px;
  height: 120px;
  margin-top: 10px;
  margin-left: 5px;
}
.textInList {
  margin-top: 4px;
}
.button1 {
  border-radius: 5px;
  font-size: 10px;
  margin-top: 25px;
  border: none;
  float: right;
}
.van-nav-bar__title {
  color: #fff;
}
.van-nav-bar {
  background-color: rgb(30, 25, 22);
}
.van-icon-arrow-left:before {
  color: #fff;
}
.van-nav-bar__text {
  color: #fff;
}
</style>
